﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="adminNew.aspx.cs" Inherits="Admin_adminNew" EnableViewState="false" %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>

</head>
<body onload='$("#loading").hide()'>
<form id="form1" runat="server">    
<div class="container" id="cpcontainer">
<div id="loading" style="display:block" >   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>

<table class="tb">
<tr class="thead"><th colspan="15" style="height: 25px">新闻管理</th></tr>	
<tr><td align="left" colspan="10">  

关键字<input  name="keyword" type="text" id="keyword" size="20">
<%=NewsClassDp("pclassType")%>
<input type="button" name="selectBtn"  value="查 询..." class="btn" onclick='SelectKey("?")'/>&nbsp;

</td>
</tr>
  <tr bgcolor="#f5fafe">
	<td style="width: 5%; height: 25px;">
        新闻ID<a href="#"><img src="imgs/minus.gif" title="按ID排序" /></a></td>
	<td style="width: 15%; height: 25px;"> 新闻名称</td>
        <td style="width: 20%; height: 25px;">新闻类别</td>
	<td style="width: 10%; height: 25px;">
        发布时间<a href="#"><img src="imgs/minus.gif" title="按时间排序" /></a></td>
	<td style="width: 10%; height: 25px;">
        最新修改时间<a href="#"><img src="imgs/minus.gif" title="按时间排序" /></a></td>

	<td style="width: 35%; height: 25px;" align="left">
        操作</td>
  </tr>
  
      <asp:Repeater ID="Repeater1" runat="server">
      <ItemTemplate>
<tr bgcolor="#f5fafe">
	<td ><input type="checkbox" value='<%#Eval("newId") %>' name="m_id"   class="checkbox" /><%#Eval("newId")%></td>
	<td style="width: 179px"><a href="EditNew.aspx?nid=<%#Eval("newId") %>" target="_self"><%#Eval("newName") %></a><span id="state1"><img src="imgs/icon_01.gif"   style="cursor:pointer"  /></                                span>
	</td>	
	<td>
        <span style="color: #2366a8"><div id="ncid<%#Eval("newId") %>"><%#getNameByClassId(Convert.ToInt32(Eval("newClassId")))%> </div></span></td>
	<td><span style='color:#2366A8;font-size:10px'><%#Eval("newSDate") %></span></td>
	<td><span><span style='color:#2366A8;font-size:10px'><%#Eval("newEDate") %></span></span></td>  
	<td style="width: 600px">	 
	   <input id="Button5" type="button" value="编辑" class='btn' title='<%#Eval("newId") %>' onclick="javascript:location.href='EditNew.aspx?nid='+this.title"/>
	   <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("newId") %>' onclick="if(confirm('确定要删除吗')){$('#loading').show();ajax_get('?action=delAll&id='+this.title+$('#HiddenUrl').attr('value'),'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide();});}else{return false}"/>
	</td>
  </tr>
        
      </ItemTemplate>
      </asp:Repeater>


<tr><td colspan="11"><div class="cuspages"><div class="pages" id="pro"><div style="width:90%; float:left;">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll(this.checked,'m_id')" />反选<input type="checkbox" name="chkothers" id="chkothers" class="checkbox" onclick="checkOthers('m_id')" />

<%=NewsClassDp("nctp")%>
<input type="button"   value="批量移动" class="btn" onclick="doPostMove('','m_id')"/>&nbsp;</div>
<div style="float:right; width:10%; text-align: center;"><input type="button" value="批量删除" onclick="doPostDeletes('','m_id')" class="btn"  style="color:Red;" />&nbsp;</div>
    </div></div></td>
</tr>

<tr><td colspan="11"><div class="cuspages"><div class="pages">
 <%htmlPaging();%></div></div></td>
</tr>
<%=input %>
</table>
</div>
<uc1:adminfoot ID="Adminfoot1" runat="server" />
<%--删除,移动,start--%>
<script type="text/javascript" >
    function  doPostDeletes(url,sname)
    {   
        var ids=getIDList(sname);
        if(ids!="")
        {
            if((confirm("确定要删除这些记录?"))==true)
            {
                $("#loading").show(); 
                url=convertURL(url+"?action=delAll&id="+ids+$("#HiddenUrl").attr("value"));
                ajax_get(url,'',function(msg)
                {                    
                   $("#cpcontainer").empty().append(msg);
                   $("#loading").hide();
                });
	        }
	    }
	    else
	    {
	        alert("您还没有选择要删除的项");	       
	        return false;
	    }
    }
    function doPostMove(url,sname)
    {   
        var ids=getIDList(sname);
        if(ids!="")
        {
            var yidong="";
            var Param="";
            yidong=$("#pro #nctp option:selected").attr("value");
            if((confirm("确定要移动这些记录?"))==true)
            {
                $("#loading").show(); 
                url=convertURL(url+"?action=MoveAll&id="+yidong+"&pid="+ids+$("#HiddenUrl").attr("value"));
                ajax_get(url,'',function(msg)
                {                   
                     $("#cpcontainer").empty().append(msg);  
                     $("#loading").hide();                    
                });
	        }
	    }
	    else
	    {
	        alert("您还没有选择移动项");	        
	        return false;
	    }
	    
    } 
   function SelectKey(url)
   {
      $("#loading").show();
      url=convertURL("?key="+ escape($("#keyword").attr("value"))+"&ClassId="+$("#pclassType option:selected").attr("value")+"&CurrentIndex=1");
      ajax_get(url,'',function(msg)
      {
        $("#cpcontainer").empty().append(msg); 
        $("#loading").hide();         
      });       
   }
 </script>
<%--删除,移动,修改end--%>
    <script type="text/javascript" >
    function changePage(name)
    {
//        var pid=convertURL($(name).attr("name"));
//        $.get(pid,'',function(data,state){$("#cpcontainer").empty().append(data)}); 
    }
    </script>
 
    </form>
</body>
</html>
